<?php

/**
 * @package    FirstSeec
 * @subpackage form
 * @author     Haomin Zhu
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseSeecUserLoginForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'username'   => new sfWidgetFormInputText(),
      'password'   => new sfWidgetFormInputPassword(),
    ));

    $this->setValidators(array(
      'username'   => new sfValidatorEmail(array('max_length' => 255)),
      'password'   => new sfValidatorString(array('max_length' => 32)),
    ));

    // Haomin: What's the function of the following 4 statements?
    $this->validatorSchema->setPostValidator(
       new sfValidatorDoctrineChoice(array('model' => 'SeecUser', 'column' => array('username')))
    );

    $this->widgetSchema->setNameFormat('seec_user[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 
    $this->setupInheritance();
    
    parent::setup();
  }

  public function getModelName()
  {
    return 'SeecUser';
  }

}
